﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.VisualStudio.Project;
using IOleServiceProvider = Microsoft.VisualStudio.OLE.Interop.IServiceProvider;

namespace PSLib.WOWAddon.Base
{
	/// <summary>
	/// Class manage projects creation
	/// </summary>
	[Guid(GuidList.guidProjectFactoryString)]
	public class WOWAddonProjectFactory : ProjectFactory
	{
		public WOWAddonProjectFactory(ProjectPackage package)
			: base(package)
		{
			this.package = package;
		}

		#region ProjectFactory overrides

		/// <summary>
		/// Creates new project node instance.
		/// </summary>
		/// <returns>New initialized project node instance.</returns>
		protected override ProjectNode CreateProject()
		{
			ProjectNode project = new WOWAddonProjectNode(this.package);
			project.SetSite((IOleServiceProvider)((IServiceProvider)this.package).GetService(typeof(IOleServiceProvider)));
			return project;
		}

		#endregion

		private ProjectPackage package;
	}
}
